<template>
  <section>
    <div>
        <h2>自动获取数据</h2>
        <el-button @click="stopAutoGetdata">关闭</el-button>
        <el-button type="primary" v-show="showOpenAuto" @click="startAutoGetdata(true)">开启</el-button>
    </div>
    <!-- 可选择补充单项数据 -->
    <ReplenishSingle></ReplenishSingle>
    <!-- D、D + 1、D - 1 -->
    <DateDConfig></DateDConfig>
    <!-- 120 节点的数据 -->
    <BatchData></BatchData>
    <!-- 获取某个节点的数据 -->
    <NodeData></NodeData>
  </section>
</template>

<script setup lang="ts">
import ReplenishSingle from '../ReplenishSingle/index.vue'
import DateDConfig from '../DateDConfig/index.vue'
import BatchData from '../BatchData/index.vue'
import NodeData from '../NodeData/index.vue'
import { startAutoGetdata, stopAutoGetdata } from '../../generate';
import { computed } from 'vue';

const showOpenAuto = computed(() => import.meta.env.VITE_APP_GETDATA_WAY === 'auto')

</script>